package com.zyw.auth.dao;

import com.zyw.auth.domain.Administrator;
import com.zyw.auth.model.AdministratorEditModel;
import com.zyw.auth.model.AdministratorListItem;
import com.zyw.auth.model.AdministratorQueryParams;
import com.zyw.kayla.infra.cache.mapper.BaseCrudMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

@Mapper
public interface AdministratorDao extends BaseCrudMapper<Administrator> {
    /**
     * 根据用户名查找用户
     *
     * @param userName  用户名
     * @param cProperty 数据状态
     */
    Administrator findByUserName(@Param("userName") String userName,
                                 @Param("cProperty") Integer cProperty);


    /**
     * 根据主键查询管理员（包括角色信息）
     *
     * @param adminId
     * @return
     */
    AdministratorEditModel findEditModel(@Param("adminId") Long adminId);


    /**
     * 分页查询列表
     *
     * @return
     */
    List<AdministratorListItem> queryPageData(Map<String, Object> queryParams);

    /**
     * 获取总数
     *
     * @return
     */
    long getTotalCount(AdministratorQueryParams adminQueryParams);

}